<template>
  <div style="width: 100%">
    <el-table :data="tableData" stripe style="width: 100%">
      <el-table-column label="生成日期" width="200">
        <template slot-scope="scope">
          <span>{{$utils.formatDateTime(scope.row.add_time)}}</span>
        </template>
      </el-table-column>
      <el-table-column prop="integral" label="积分" width="200">
        <template slot-scope="scope">
          <span
            :style="scope.row.integral>0?'color:#5cb85c':'color:#f7b7b7'"
          >{{scope.row.integral>0?'+'+scope.row.integral:scope.row.integral}}</span>
        </template>
      </el-table-column>
      <el-table-column prop="text" label="详情"></el-table-column>
      <el-table-column label="备注">
        <template slot-scope="scope">
          <span>{{scope.row.other==""?"-":scope.row.other}}</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
export default {
  name: "igfloginlog",
  data() {
    return {
      tableData: []
    };
  },
  props: {
    username: {
      type: String,
      default: ""
    }
  },
  methods: {},
  watch: {},
  created() {
    this.$http
      .post("/log/integrallog", {
        username: this.username
      })
      .then(res => {
        this.isLoaded = true;
        if (res.code == 200) {
          this.tableData = res.data.list;
        } else {
          this.$message.error(res.msg);
        }
      })
      .catch(err => {
        this.$message.error(err.msg);
      });
  }
};
</script>

<style scoped>
</style>
